Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to allow fuzzy-match filter in json-api #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cecemel
Copy link
Contributor

@cecemel cecemel commented May 8, 2020

Hello,

with regard to #60, I started implementing, or rather, looking for ways to implement extensions on the current filtering possibilities.

Some notes

General

Here, I wanted fuzzy text search on a String attribute. I validated this against the fortune-postgres, which needed to be extened too.
You may find the relevant commit here: cecemel/fortune-postgres@e804615. I didn't start a PR for this one yet. I just want first to make sure we agree on interface and how the query is passed down through all layers.
So I consider this PR a base for discussion.

Regarding integration into fortune.js

I am unsure what field of request.options may be used. The fortune-postgres seemed to already use the query field, of which at first sight seemed to be the wanted escape hatch, so I didn't feel like using this.

So, as I understand it, Adapter.find leaves the possibility of extra fields on the options object unspecified. Therefore, I added fuzzyMatch on the options object.

Regarding validity JSON:API

Filtering is relatively unspecified. As such, I assume the extra filter
type is legal.

Notes
-----
Regarding integration into fortune.js

I am unsure what field of request.options may be used.
As I understand it, Adapter.find leaves the possibility of extra
fields on the options object unspecified. Therefore, I added the
fuzzyMatch on the ptions object.

Regarding validity JSON:API

Filtering is relatively unspecified. As such, I assume the extra filter
type is legal.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant